package com.zoshine.zzg.pojo.table.base;

import java.util.ArrayList;
import java.util.List;

/**
 * 表信息实体类
 * @author 贾俊峰
 * @time 2017/8/10 15:29
 */
public class Table {
    /**表名*/
    private final String tableName;
    /**表注释*/
    private final String comment;
    /**主键约束*/
    private final String primaryKey;
    /**唯一约束*/
    private final String unique;
    /**列列表*/
    private final List<Column> columns = new ArrayList<>();

    public Table(String tableName, String comment, String primaryKey, String unique) {
        this.tableName = tableName;
        this.comment = comment;
        this.primaryKey = primaryKey;
        this.unique = unique;
    }

    /**
     * 添加列
     */
    public void addColumn(Column column) {
        columns.add(column);
    }

    public String getTableName() {
        return tableName;
    }

    public String getComment() {
        return comment;
    }

    public String getPrimaryKey() {
        return primaryKey;
    }

    public String getUnique() {
        return unique;
    }

    public List<Column> getColumns() {
        return columns;
    }
}
